﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// abstract ObracunKamataStavke typed datagridview
	/// </summary>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class ObracunKamataStavkeDataGridViewBase : System.Windows.Forms.UserControl
	{	
		/// <summary> 
		/// Thrown when the current Entity changed.
		/// </summary>
		public event System.EventHandler<ObracunKamataStavkeDataGridViewEventArgs> CurrentEntityChanged;
		
		#region Fields
				
		/// <summary> 
		/// the current entity.
		/// </summary>
		private Entities.ObracunKamataStavke _currentObracunKamataStavke = null;
		//private Dictionary<string, string> _columnsHeaders = new Dictionary<string, string>();
		
		/// <summary> 
		/// the datagridview instance
		/// </summary>
		protected System.Windows.Forms.DataGridView uxObracunKamataStavkeDataGridView;
		
		/// <summary> 
		/// the errorprovider
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxObracunKamataStavkeErrorProvider;
		
		/// <summary> 
		/// the bindingsource
		/// </summary>
		protected System.Windows.Forms.BindingSource uxObracunKamataStavkeBindingSource;
		
		
		/// <summary> 
		/// the DGV column associated with the ID property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDObracunKamata property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDObracunKamataDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Faktura property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxFakturaDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDKnjizenje property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDKnjizenjeDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DatumFakture property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDatumFaktureDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DatumZadnjeUplate property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDatumZadnjeUplateDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Iznos property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIznosDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the RazdobljeOd property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxRazdobljeOdDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the RazdobljeDo property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxRazdobljeDoDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Dana property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDanaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Stopa property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxStopaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the IznosKamate property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIznosKamateDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the StopaOd property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxStopaOdDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the StopaDo property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxStopaDoDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the IDUserCreated property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDUserCreatedDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the IDUserModified property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDUserModifiedDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DateCreated property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDateCreatedDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DateModified property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDateModifiedDataGridViewColumn;
		
		#endregion
					
		#region Combo list
		
				
		private Entities.TList<Entities.ObracunKamata> _IDObracunKamataList;
		
		/// <summary> 
		/// The list of selectable ObracunKamata
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.ObracunKamata> IDObracunKamataList
		{
			get {return this._IDObracunKamataList;}
			set 
			{
				this._IDObracunKamataList = value;
				this.uxIDObracunKamataDataGridViewColumn.DataSource = null;
				this.uxIDObracunKamataDataGridViewColumn.DataSource = this._IDObracunKamataList;
			}
		}
		
		private bool _allowNewItemInIDObracunKamataList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of ObracunKamata
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDObracunKamataList
		{
			get { return _allowNewItemInIDObracunKamataList;}
			set
			{
				this._allowNewItemInIDObracunKamataList = value;
				this.uxIDObracunKamataDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
				
		private Entities.TList<Entities.KnjizenjeStavka> _IDKnjizenjeList;
		
		/// <summary> 
		/// The list of selectable KnjizenjeStavka
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.KnjizenjeStavka> IDKnjizenjeList
		{
			get {return this._IDKnjizenjeList;}
			set 
			{
				this._IDKnjizenjeList = value;
				this.uxIDKnjizenjeDataGridViewColumn.DataSource = null;
				this.uxIDKnjizenjeDataGridViewColumn.DataSource = this._IDKnjizenjeList;
			}
		}
		
		private bool _allowNewItemInIDKnjizenjeList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of KnjizenjeStavka
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDKnjizenjeList
		{
			get { return _allowNewItemInIDKnjizenjeList;}
			set
			{
				this._allowNewItemInIDKnjizenjeList = value;
				this.uxIDKnjizenjeDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
		#endregion
		
		#region Main Datasource
		
		private Entities.TList<Entities.ObracunKamataStavke> _ObracunKamataStavkeList;
				
		/// <summary> 
		/// The list of ObracunKamataStavke to be displayed in the DGV.
		/// </summary>
		[System.ComponentModel.Category("Data")]
		public Entities.TList<Entities.ObracunKamataStavke> ObracunKamataStavkeList
		{
			get {return this._ObracunKamataStavkeList;}
			set
			{
				this._ObracunKamataStavkeList = value;
				this.uxObracunKamataStavkeBindingSource.DataSource = null;
				this.uxObracunKamataStavkeBindingSource.DataSource = value;
				this.uxObracunKamataStavkeDataGridView.DataSource = null;
				this.uxObracunKamataStavkeDataGridView.DataSource = this.uxObracunKamataStavkeBindingSource;				
				//this.uxObracunKamataStavkeBindingSource.ListChanged += new System.ComponentModel.ListChangedEventHandler(uxObracunKamataStavkeBindingSource_ListChanged);
				this.uxObracunKamataStavkeBindingSource.CurrentItemChanged += new System.EventHandler(OnObracunKamataStavkeBindingSourceCurrentItemChanged);
			}
		}
		
		private void OnObracunKamataStavkeBindingSourceCurrentItemChanged(object sender, System.EventArgs e)
		{
			_currentObracunKamataStavke = uxObracunKamataStavkeBindingSource.Current as Entities.ObracunKamataStavke;
			
			if (_currentObracunKamataStavke != null)
			{
				_currentObracunKamataStavke.Validate();
			}
			//_ObracunKamataStavke.Validate();
			OnCurrentEntityChanged();
		}

		//void uxObracunKamataStavkeBindingSource_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
		//{
			//throw new Exception("The method or operation is not implemented.");
		//}		
		
		#endregion
		
		/// <summary>
		/// Gets the currently selected <c cref="Entities.ObracunKamataStavke"/> instance.
		/// </summary>
		public Entities.ObracunKamataStavke SelectedObracunKamataStavke
		{
			get {return this._currentObracunKamataStavke;}
		}
		
		#region other properties
		
		/// <summary>
		/// Gets or sets a value indicating whether you have provided your own data-management operations for the DataGridView control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool VirtualMode
		{
			get {return this.uxObracunKamataStavkeDataGridView.VirtualMode;}
			set
			{
				this.uxObracunKamataStavkeDataGridView.VirtualMode = value;
			}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the option to add rows is displayed to the user.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToAddRows
		{
			get {return this.uxObracunKamataStavkeDataGridView.AllowUserToAddRows;}
			set {this.uxObracunKamataStavkeDataGridView.AllowUserToAddRows = value;}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToDeleteRows
		{
			get {return this.uxObracunKamataStavkeDataGridView.AllowUserToDeleteRows;}
			set {this.uxObracunKamataStavkeDataGridView.AllowUserToDeleteRows = value;}
		}
		
		/// <summary>
		/// Gets the <c cref="DataGridView"/> instance.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public System.Windows.Forms.DataGridView DataGridView
		{
			get {return this.uxObracunKamataStavkeDataGridView;}
		}
		
		/// <summary>
		/// Gets a collection that contains all the columns in the control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]		
		[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)]
		//[System.ComponentModel.EditorAttribute("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))] 
		public System.Windows.Forms.DataGridViewColumnCollection Columns
		{
			get { return this.uxObracunKamataStavkeDataGridView.Columns; }
		}
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;
	
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	
		#region Constructor
	
		/// <summary>
		/// Initializes a new instance of the <see cref="ObracunKamataStavkeDataGridViewBase"/> class.
		/// </summary>
		public ObracunKamataStavkeDataGridViewBase()
		{			
			this.components = new System.ComponentModel.Container();			
			
			this.uxObracunKamataStavkeDataGridView = new System.Windows.Forms.DataGridView();
			this.uxObracunKamataStavkeBindingSource = new System.Windows.Forms.BindingSource(this.components);
			this.uxObracunKamataStavkeErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxIDDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDObracunKamataDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxFakturaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDKnjizenjeDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxDatumFaktureDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDatumZadnjeUplateDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIznosDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxRazdobljeOdDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxRazdobljeDoDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDanaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxStopaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIznosKamateDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxStopaOdDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxStopaDoDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDUserCreatedDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDUserModifiedDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDateCreatedDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDateModifiedDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			//this.uxIDObracunKamataBindingSource = new ObracunKamataBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDObracunKamataBindingSource)).BeginInit();
			//this.uxIDKnjizenjeBindingSource = new KnjizenjeStavkaBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDKnjizenjeBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxObracunKamataStavkeDataGridView)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxObracunKamataStavkeBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxObracunKamataStavkeErrorProvider)).BeginInit();
			this.SuspendLayout();
						
			// 
			// uxObracunKamataStavkeErrorProvider
			// 
			this.uxObracunKamataStavkeErrorProvider.ContainerControl = this;
			this.uxObracunKamataStavkeErrorProvider.DataSource = this.uxObracunKamataStavkeBindingSource;						
			// 
			// uxObracunKamataStavkeDataGridView
			// 
			this.uxObracunKamataStavkeDataGridView.AutoGenerateColumns = false;
			this.uxObracunKamataStavkeDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.uxObracunKamataStavkeDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
		this.uxIDDataGridViewColumn,
		this.uxIDObracunKamataDataGridViewColumn,
		this.uxFakturaDataGridViewColumn,
		this.uxIDKnjizenjeDataGridViewColumn,
		this.uxDatumFaktureDataGridViewColumn,
		this.uxDatumZadnjeUplateDataGridViewColumn,
		this.uxIznosDataGridViewColumn,
		this.uxRazdobljeOdDataGridViewColumn,
		this.uxRazdobljeDoDataGridViewColumn,
		this.uxDanaDataGridViewColumn,
		this.uxStopaDataGridViewColumn,
		this.uxIznosKamateDataGridViewColumn,
		this.uxStopaOdDataGridViewColumn,
		this.uxStopaDoDataGridViewColumn,
		this.uxIDUserCreatedDataGridViewColumn,
		this.uxIDUserModifiedDataGridViewColumn,
		this.uxDateCreatedDataGridViewColumn,
		this.uxDateModifiedDataGridViewColumn			});
			this.uxObracunKamataStavkeDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
			this.uxObracunKamataStavkeDataGridView.Location = new System.Drawing.Point(0, 0);
			this.uxObracunKamataStavkeDataGridView.Name = "uxObracunKamataStavkeDataGridView";
			this.uxObracunKamataStavkeDataGridView.Size = new System.Drawing.Size(470, 300);
			this.uxObracunKamataStavkeDataGridView.TabIndex = 0;	
			this.uxObracunKamataStavkeDataGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke;
			this.uxObracunKamataStavkeDataGridView.EnableHeadersVisualStyles = false;
			this.uxObracunKamataStavkeDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.OnObracunKamataStavkeDataGridViewDataError);
			this.uxObracunKamataStavkeDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnObracunKamataStavkeDataGridViewCellValueNeeded);
			this.uxObracunKamataStavkeDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnObracunKamataStavkeDataGridViewCellValuePushed);
			
			//
			// uxIDDataGridViewColumn
			//
			this.uxIDDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDDataGridViewColumn.DataPropertyName = "ID";
			this.uxIDDataGridViewColumn.HeaderText = "ID";
			this.uxIDDataGridViewColumn.Name = "uxIDDataGridViewColumn";
			this.uxIDDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDDataGridViewColumn.ReadOnly = true;		
			//
			// uxIDObracunKamataDataGridViewColumn
			//
			this.uxIDObracunKamataDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDObracunKamataDataGridViewColumn.DataPropertyName = "IDObracunKamata";
			this.uxIDObracunKamataDataGridViewColumn.HeaderText = "IDObracunKamata";
			this.uxIDObracunKamataDataGridViewColumn.Name = "uxIDObracunKamataDataGridViewColumn";
			this.uxIDObracunKamataDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDObracunKamataDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDObracunKamataDataGridViewColumn.ReadOnly = false;		
			//
			// uxFakturaDataGridViewColumn
			//
			this.uxFakturaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxFakturaDataGridViewColumn.DataPropertyName = "Faktura";
			this.uxFakturaDataGridViewColumn.HeaderText = "Faktura";
			this.uxFakturaDataGridViewColumn.Name = "uxFakturaDataGridViewColumn";
			this.uxFakturaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxFakturaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxFakturaDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDKnjizenjeDataGridViewColumn
			//
			this.uxIDKnjizenjeDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDKnjizenjeDataGridViewColumn.DataPropertyName = "IDKnjizenje";
			this.uxIDKnjizenjeDataGridViewColumn.HeaderText = "IDKnjizenje";
			this.uxIDKnjizenjeDataGridViewColumn.Name = "uxIDKnjizenjeDataGridViewColumn";
			this.uxIDKnjizenjeDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDKnjizenjeDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDKnjizenjeDataGridViewColumn.ReadOnly = false;		
			//
			// uxDatumFaktureDataGridViewColumn
			//
			this.uxDatumFaktureDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDatumFaktureDataGridViewColumn.DataPropertyName = "DatumFakture";
			this.uxDatumFaktureDataGridViewColumn.HeaderText = "DatumFakture";
			this.uxDatumFaktureDataGridViewColumn.Name = "uxDatumFaktureDataGridViewColumn";
			this.uxDatumFaktureDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDatumFaktureDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDatumFaktureDataGridViewColumn.ReadOnly = false;		
			//
			// uxDatumZadnjeUplateDataGridViewColumn
			//
			this.uxDatumZadnjeUplateDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDatumZadnjeUplateDataGridViewColumn.DataPropertyName = "DatumZadnjeUplate";
			this.uxDatumZadnjeUplateDataGridViewColumn.HeaderText = "DatumZadnjeUplate";
			this.uxDatumZadnjeUplateDataGridViewColumn.Name = "uxDatumZadnjeUplateDataGridViewColumn";
			this.uxDatumZadnjeUplateDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDatumZadnjeUplateDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDatumZadnjeUplateDataGridViewColumn.ReadOnly = false;		
			//
			// uxIznosDataGridViewColumn
			//
			this.uxIznosDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIznosDataGridViewColumn.DataPropertyName = "Iznos";
			this.uxIznosDataGridViewColumn.HeaderText = "Iznos";
			this.uxIznosDataGridViewColumn.Name = "uxIznosDataGridViewColumn";
			this.uxIznosDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIznosDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIznosDataGridViewColumn.ReadOnly = false;		
			//
			// uxRazdobljeOdDataGridViewColumn
			//
			this.uxRazdobljeOdDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxRazdobljeOdDataGridViewColumn.DataPropertyName = "RazdobljeOd";
			this.uxRazdobljeOdDataGridViewColumn.HeaderText = "RazdobljeOd";
			this.uxRazdobljeOdDataGridViewColumn.Name = "uxRazdobljeOdDataGridViewColumn";
			this.uxRazdobljeOdDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxRazdobljeOdDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxRazdobljeOdDataGridViewColumn.ReadOnly = false;		
			//
			// uxRazdobljeDoDataGridViewColumn
			//
			this.uxRazdobljeDoDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxRazdobljeDoDataGridViewColumn.DataPropertyName = "RazdobljeDo";
			this.uxRazdobljeDoDataGridViewColumn.HeaderText = "RazdobljeDo";
			this.uxRazdobljeDoDataGridViewColumn.Name = "uxRazdobljeDoDataGridViewColumn";
			this.uxRazdobljeDoDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxRazdobljeDoDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxRazdobljeDoDataGridViewColumn.ReadOnly = false;		
			//
			// uxDanaDataGridViewColumn
			//
			this.uxDanaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDanaDataGridViewColumn.DataPropertyName = "Dana";
			this.uxDanaDataGridViewColumn.HeaderText = "Dana";
			this.uxDanaDataGridViewColumn.Name = "uxDanaDataGridViewColumn";
			this.uxDanaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDanaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDanaDataGridViewColumn.ReadOnly = false;		
			//
			// uxStopaDataGridViewColumn
			//
			this.uxStopaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxStopaDataGridViewColumn.DataPropertyName = "Stopa";
			this.uxStopaDataGridViewColumn.HeaderText = "Stopa";
			this.uxStopaDataGridViewColumn.Name = "uxStopaDataGridViewColumn";
			this.uxStopaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxStopaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxStopaDataGridViewColumn.ReadOnly = false;		
			//
			// uxIznosKamateDataGridViewColumn
			//
			this.uxIznosKamateDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIznosKamateDataGridViewColumn.DataPropertyName = "IznosKamate";
			this.uxIznosKamateDataGridViewColumn.HeaderText = "IznosKamate";
			this.uxIznosKamateDataGridViewColumn.Name = "uxIznosKamateDataGridViewColumn";
			this.uxIznosKamateDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIznosKamateDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIznosKamateDataGridViewColumn.ReadOnly = false;		
			//
			// uxStopaOdDataGridViewColumn
			//
			this.uxStopaOdDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxStopaOdDataGridViewColumn.DataPropertyName = "StopaOd";
			this.uxStopaOdDataGridViewColumn.HeaderText = "StopaOd";
			this.uxStopaOdDataGridViewColumn.Name = "uxStopaOdDataGridViewColumn";
			this.uxStopaOdDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxStopaOdDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxStopaOdDataGridViewColumn.ReadOnly = false;		
			//
			// uxStopaDoDataGridViewColumn
			//
			this.uxStopaDoDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxStopaDoDataGridViewColumn.DataPropertyName = "StopaDo";
			this.uxStopaDoDataGridViewColumn.HeaderText = "StopaDo";
			this.uxStopaDoDataGridViewColumn.Name = "uxStopaDoDataGridViewColumn";
			this.uxStopaDoDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxStopaDoDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxStopaDoDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDUserCreatedDataGridViewColumn
			//
			this.uxIDUserCreatedDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDUserCreatedDataGridViewColumn.DataPropertyName = "IDUserCreated";
			this.uxIDUserCreatedDataGridViewColumn.HeaderText = "IDUserCreated";
			this.uxIDUserCreatedDataGridViewColumn.Name = "uxIDUserCreatedDataGridViewColumn";
			this.uxIDUserCreatedDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDUserCreatedDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDUserCreatedDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDUserModifiedDataGridViewColumn
			//
			this.uxIDUserModifiedDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDUserModifiedDataGridViewColumn.DataPropertyName = "IDUserModified";
			this.uxIDUserModifiedDataGridViewColumn.HeaderText = "IDUserModified";
			this.uxIDUserModifiedDataGridViewColumn.Name = "uxIDUserModifiedDataGridViewColumn";
			this.uxIDUserModifiedDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDUserModifiedDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDUserModifiedDataGridViewColumn.ReadOnly = false;		
			//
			// uxDateCreatedDataGridViewColumn
			//
			this.uxDateCreatedDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDateCreatedDataGridViewColumn.DataPropertyName = "DateCreated";
			this.uxDateCreatedDataGridViewColumn.HeaderText = "DateCreated";
			this.uxDateCreatedDataGridViewColumn.Name = "uxDateCreatedDataGridViewColumn";
			this.uxDateCreatedDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDateCreatedDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDateCreatedDataGridViewColumn.ReadOnly = false;		
			//
			// uxDateModifiedDataGridViewColumn
			//
			this.uxDateModifiedDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDateModifiedDataGridViewColumn.DataPropertyName = "DateModified";
			this.uxDateModifiedDataGridViewColumn.HeaderText = "DateModified";
			this.uxDateModifiedDataGridViewColumn.Name = "uxDateModifiedDataGridViewColumn";
			this.uxDateModifiedDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDateModifiedDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDateModifiedDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDObracunKamataDataGridViewColumn
			//				
			this.uxIDObracunKamataDataGridViewColumn.DisplayMember = "IDKlijent";	
			this.uxIDObracunKamataDataGridViewColumn.ValueMember = "ID";	
			this.uxIDObracunKamataDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDObracunKamataDataGridViewColumn.DataSource = uxIDObracunKamataBindingSource;				
				
			//
			// uxIDKnjizenjeDataGridViewColumn
			//				
			this.uxIDKnjizenjeDataGridViewColumn.DisplayMember = "IDKonto";	
			this.uxIDKnjizenjeDataGridViewColumn.ValueMember = "ID";	
			this.uxIDKnjizenjeDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDKnjizenjeDataGridViewColumn.DataSource = uxIDKnjizenjeBindingSource;				
				
			
			// this
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.uxObracunKamataStavkeDataGridView);
			this.Name = "ObracunKamataStavkeDataGridView";
			this.Size = new System.Drawing.Size(470, 300);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDObracunKamataBindingSource)).EndInit();
			//((System.ComponentModel.ISupportInitialize)(this.uxIDKnjizenjeBindingSource)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxObracunKamataStavkeErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxObracunKamataStavkeDataGridView)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxObracunKamataStavkeBindingSource)).EndInit();
			this.ResumeLayout(false);
		}
		#endregion
				
		#region events
		
		/// <summary>
		/// Raised the CurrentEntityChanged event.
		/// </summary>
		protected void OnCurrentEntityChanged()
		{
			if (CurrentEntityChanged != null)
			{
				ObracunKamataStavkeDataGridViewEventArgs args = new ObracunKamataStavkeDataGridViewEventArgs();
				args.ObracunKamataStavke = _currentObracunKamataStavke;
				CurrentEntityChanged(this, args); 
			}
		}
		
		#endregion
		
		/// <summary>
		/// Strongly typed event 
		/// </summary>
		public class ObracunKamataStavkeDataGridViewEventArgs : System.EventArgs
		{
			private Entities.ObracunKamataStavke	_ObracunKamataStavke;
	
			/// <summary>
			/// the  Entities.ObracunKamataStavke instance.
			/// </summary>
			public Entities.ObracunKamataStavke ObracunKamataStavke
			{
				get { return _ObracunKamataStavke; }
				set { _ObracunKamataStavke = value; }
			}	
		}
		
		/// <summary>
		/// Handles the DataError event of the uxObracunKamataStavkeDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewDataErrorEventArgs"/> instance containing the event data.</param>
		protected void OnObracunKamataStavkeDataGridViewDataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine(string.Format( "{0}, {1}", e.ColumnIndex, e.RowIndex));
		}
		
		/// <summary>
		/// Handles the CellValueNeeded event of the uxObracunKamataStavkeDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnObracunKamataStavkeDataGridViewCellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxObracunKamataStavkeDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						e.Value = ObracunKamataStavkeList[e.RowIndex].ID;
						break;
					case "uxIDObracunKamataDataGridViewColumn":
						e.Value = ObracunKamataStavkeList[e.RowIndex].IDObracunKamata;
						break;
					case "uxFakturaDataGridViewColumn":
						e.Value = ObracunKamataStavkeList[e.RowIndex].Faktura;
						break;
					case "uxIDKnjizenjeDataGridViewColumn":
						e.Value = ObracunKamataStavkeList[e.RowIndex].IDKnjizenje;
						break;
					case "uxDatumFaktureDataGridViewColumn":
						e.Value = ObracunKamataStavkeList[e.RowIndex].DatumFakture;
						break;
					case "uxDatumZadnjeUplateDataGridViewColumn":
						e.Value = ObracunKamataStavkeList[e.RowIndex].DatumZadnjeUplate;
						break;
					case "uxIznosDataGridViewColumn":
						e.Value = ObracunKamataStavkeList[e.RowIndex].Iznos;
						break;
					case "uxRazdobljeOdDataGridViewColumn":
						e.Value = ObracunKamataStavkeList[e.RowIndex].RazdobljeOd;
						break;
					case "uxRazdobljeDoDataGridViewColumn":
						e.Value = ObracunKamataStavkeList[e.RowIndex].RazdobljeDo;
						break;
					case "uxDanaDataGridViewColumn":
						e.Value = ObracunKamataStavkeList[e.RowIndex].Dana;
						break;
					case "uxStopaDataGridViewColumn":
						e.Value = ObracunKamataStavkeList[e.RowIndex].Stopa;
						break;
					case "uxIznosKamateDataGridViewColumn":
						e.Value = ObracunKamataStavkeList[e.RowIndex].IznosKamate;
						break;
					case "uxStopaOdDataGridViewColumn":
						e.Value = ObracunKamataStavkeList[e.RowIndex].StopaOd;
						break;
					case "uxStopaDoDataGridViewColumn":
						e.Value = ObracunKamataStavkeList[e.RowIndex].StopaDo;
						break;
					case "uxIDUserCreatedDataGridViewColumn":
						e.Value = ObracunKamataStavkeList[e.RowIndex].IDUserCreated;
						break;
					case "uxIDUserModifiedDataGridViewColumn":
						e.Value = ObracunKamataStavkeList[e.RowIndex].IDUserModified;
						break;
					case "uxDateCreatedDataGridViewColumn":
						e.Value = ObracunKamataStavkeList[e.RowIndex].DateCreated;
						break;
					case "uxDateModifiedDataGridViewColumn":
						e.Value = ObracunKamataStavkeList[e.RowIndex].DateModified;
						break;
				default:
				break;
			}
		}
		
		/// <summary>
		/// Handles the CellValuePushed event of the uxObracunKamataStavkeDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnObracunKamataStavkeDataGridViewCellValuePushed(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxObracunKamataStavkeDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						ObracunKamataStavkeList[e.RowIndex].ID = (System.Int32)e.Value;
						break;
					case "uxIDObracunKamataDataGridViewColumn":
						ObracunKamataStavkeList[e.RowIndex].IDObracunKamata = (System.Int32)e.Value;
						break;
					case "uxFakturaDataGridViewColumn":
						ObracunKamataStavkeList[e.RowIndex].Faktura = (System.String)e.Value;
						break;
					case "uxIDKnjizenjeDataGridViewColumn":
						ObracunKamataStavkeList[e.RowIndex].IDKnjizenje = (System.Int32)e.Value;
						break;
					case "uxDatumFaktureDataGridViewColumn":
						ObracunKamataStavkeList[e.RowIndex].DatumFakture = (System.DateTime)e.Value;
						break;
					case "uxDatumZadnjeUplateDataGridViewColumn":
						ObracunKamataStavkeList[e.RowIndex].DatumZadnjeUplate = (System.DateTime)e.Value;
						break;
					case "uxIznosDataGridViewColumn":
						ObracunKamataStavkeList[e.RowIndex].Iznos = (System.Decimal)e.Value;
						break;
					case "uxRazdobljeOdDataGridViewColumn":
						ObracunKamataStavkeList[e.RowIndex].RazdobljeOd = (System.DateTime)e.Value;
						break;
					case "uxRazdobljeDoDataGridViewColumn":
						ObracunKamataStavkeList[e.RowIndex].RazdobljeDo = (System.DateTime)e.Value;
						break;
					case "uxDanaDataGridViewColumn":
						ObracunKamataStavkeList[e.RowIndex].Dana = (System.Int32)e.Value;
						break;
					case "uxStopaDataGridViewColumn":
						ObracunKamataStavkeList[e.RowIndex].Stopa = (System.Double)e.Value;
						break;
					case "uxIznosKamateDataGridViewColumn":
						ObracunKamataStavkeList[e.RowIndex].IznosKamate = (System.Decimal)e.Value;
						break;
					case "uxStopaOdDataGridViewColumn":
						ObracunKamataStavkeList[e.RowIndex].StopaOd = (System.DateTime)e.Value;
						break;
					case "uxStopaDoDataGridViewColumn":
						ObracunKamataStavkeList[e.RowIndex].StopaDo = (System.DateTime)e.Value;
						break;
					case "uxIDUserCreatedDataGridViewColumn":
						ObracunKamataStavkeList[e.RowIndex].IDUserCreated = (System.Int32)e.Value;
						break;
					case "uxIDUserModifiedDataGridViewColumn":
						ObracunKamataStavkeList[e.RowIndex].IDUserModified = (System.Int32)e.Value;
						break;
					case "uxDateCreatedDataGridViewColumn":
						ObracunKamataStavkeList[e.RowIndex].DateCreated = (System.DateTime)e.Value;
						break;
					case "uxDateModifiedDataGridViewColumn":
						ObracunKamataStavkeList[e.RowIndex].DateModified = (System.DateTime)e.Value;
						break;
				default:
				break;
			}
		}
	}
}
